/*
 * PacketAdapter.h
 *
 *  Created on: Sep 16, 2017
 *      Author: zjf
 */

#ifndef INCLUDE_PACKET_H_
#define INCLUDE_PACKET_H_

#include <Poco/AutoPtr.h>
#include <Poco/RefCountedObject.h>
#include <Poco/Types.h>

using namespace Poco;

namespace utils
{

class Packet : public RefCountedObject
{
public:
	typedef AutoPtr<Packet> Ptr;

	Packet() {}
	virtual ~Packet() {}

	virtual char* getHeader() = 0;
	virtual Int32 getHeaderSize() = 0;
	virtual bool validateHeader(std::string& errMsg) = 0;
	virtual void allocData() = 0;
	virtual char *getData() = 0;
	virtual Int32 getDataSize() = 0;
	virtual bool validateData(std::string& errMsg) = 0;
};

} /* namespace utils */

#endif /* INCLUDE_PACKET_H_ */
